#!/bin/bash

# 检查IPv4反向路径过滤是否已启用
if [[ $(sysctl -n net.ipv4.conf.all.rp_filter 2>/dev/null) -eq 1 ]]; then
    echo "通过：IPv4 all rp_filter 已启用"
else
    echo "失败：IPv4 all rp_filter 未启用"
    exit 1
fi

if [[ $(sysctl -n net.ipv4.conf.default.rp_filter 2>/dev/null) -eq 1 ]]; then
    echo "通过：IPv4 default rp_filter 已启用"
else
    echo "失败：IPv4 default rp_filter 未启用"
    exit 1
fi
